package com.xiyi.shouxin.entity.admin.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.lang.Nullable;

import com.xiyi.shouxin.entity.admin.Admin;

public class AdminMapper implements RowMapper<Admin> {

    @Override
    @Nullable
    public Admin mapRow(@Nullable ResultSet rs, int rowNum) throws SQLException {
        Admin admin = new Admin();
        if (rs == null) {
            return admin;
        }
        admin.setId(rs.getLong("id"));
        admin.setNickName(rs.getString("nickname"));
        admin.setAccount(rs.getString("account"));
        admin.setPassword(rs.getString("password"));
        admin.setRoleId(rs.getLong("role_id"));
        admin.setIsDelete(rs.getString("is_delete"));
        return admin;
    }
}
